﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Lavanderia.Entities;

namespace Lavanderia.Repository.Mapping
{
    public class EmpresaMap : EntityTypeConfiguration<Empresa>
    {
        public EmpresaMap()
        {
            this.HasKey(p => p.Id);

            this.Property(p => p.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(p => p.Ruc)
                .IsRequired();

            this.Property(p => p.RazonSocial)
                .IsRequired();

            this.Property(p => p.Direccion)
                .IsOptional();
            this.Property(p => p.Telefono)
                .IsOptional();

            this.Property(p => p.Comentario)
                .IsOptional();

            this.ToTable("EMPRESA");

            this.Property(p => p.Id).HasColumnName("Id");

            this.Property(p => p.Ruc).HasColumnName("Ruc");
            this.Property(p => p.RazonSocial).HasColumnName("RazonSocial");
            this.Property(p => p.Direccion).HasColumnName("Direccion");
            this.Property(p => p.Telefono).HasColumnName("Telefono");
            this.Property(p => p.Comentario).HasColumnName("Comentario");



        }
    }
}
